<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>设置令牌和 secret</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="oauth.settimestamp.html">OAuth::setTimestamp</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="oauth.setversion.html">OAuth::setVersion</a></div>
 <div class="up"><a href="class.oauth.html">OAuth</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="oauth.settoken" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">OAuth::setToken</h1>
  <p class="verinfo">(PECL OAuth &gt;= 0.99.1)</p><p class="refpurpose"><span class="refname">OAuth::setToken</span> &mdash; <span class="dc-title">设置令牌和 secret</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-oauth.settoken-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>OAuth::setToken</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$token</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$token_secret</code></span>
   )</div>

  <p class="para rdfs-comment">
   为后续请求设置令牌和 secret。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-oauth.settoken-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">token</code></em></dt>

     <dd>

      <p class="para">
        OAuth 令牌
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">token_secret</code></em></dt>

     <dd>

      <p class="para">
        OAuth 令牌 secret。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-oauth.settoken-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   <strong><code>TRUE</code></strong>
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-oauth.settoken-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-5171">
    <p><strong>Example #1 <span class="function"><strong>OAuth::setToken()</strong></span> 例子</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$oauth&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">OAuth</span><span style="color: #007700">(</span><span style="color: #0000BB">OAUTH_CONSUMER_KEY</span><span style="color: #007700">,</span><span style="color: #0000BB">OAUTH_CONSUMER_SECRET</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$oauth</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setToken</span><span style="color: #007700">(</span><span style="color: #DD0000">"token"</span><span style="color: #007700">,</span><span style="color: #DD0000">"token-secret"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="oauth.settimestamp.html">OAuth::setTimestamp</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="oauth.setversion.html">OAuth::setVersion</a></div>
 <div class="up"><a href="class.oauth.html">OAuth</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
